﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smartec.Accounts.Camel.AMS.Model.Entities;
using Smartec.Accounts.Camel.AMS.Model.Repository;

namespace Smartec.Accounts.Camel.AMS.Model.Facades
{
    public static class PartnersFacade
    {
        public static void AddPartners(Partners partners)
       {
           PartnersRepository.AddPartner(partners);
          
       }

        public static List<Partners> GetAllPartners()
       {
           return PartnersRepository.All();
       }

        public static Partners GetPartnerById(int id)
       {
           return PartnersRepository.All().FirstOrDefault(t => t.ID == id);
       }
       public static void Save()
       {
           PartnersRepository.Save();
       }
       public static void UpdatePartners(Partners Partner)
       {
           var _partner = GetPartnerById(Partner.ID);
           _partner.Text = Partner.Text;
           _partner.Link = Partner.Link;
       }

       public static void DeletePartnerById(int id)
       {
           PartnersRepository.DeletePartnerById(id);
       }
    }
}
